Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(theme): move LayoutProviders to Layout/Provider; composeProviders util #7676

Merged
merged 5 commits into from Jun 24, 2022

Conversation

slorber
Copy link
Collaborator

@slorber slorber commented Jun 24, 2022

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

As in other places where we nest components, move @theme/LayoutProviders to @theme/Layout/Provider

Also use a new composeProviders fn to avoid the previous ugly nesting

Thinking of maybe making ThemeCommon expose a single ThemeCommonProvider ? 🤔

Test Plan

preview

@slorber slorber added the pr: maintenance This PR does not produce any behavior differences to end users when upgrading. label Jun 24, 2022
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Jun 24, 2022
@netlify
Copy link

netlify bot commented Jun 24, 2022

[V2]

Name Link
🔨 Latest commit 0c348e3
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/62b5e1617ddd770008bf5a7f
😎 Deploy Preview https://deploy-preview-7676--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions
Copy link

github-actions bot commented Jun 24, 2022

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 83 🟢 100 🟢 100 🟢 100 🟢 90 Report
/docs/installation 🟠 80 🟢 100 🟢 100 🟢 100 🟢 90 Report

@Josh-Cena Josh-Cena changed the title refactor(theme): LayoutProviders moved to Layout/Provider + composeProvider refactor(theme): move LayoutProviders to Layout/Provider; composeProviders util Jun 24, 2022
@Josh-Cena
Copy link
Collaborator

Thinking of maybe making ThemeCommon expose a single ThemeCommonProvider ? 🤔

I think it's better this way.

@slorber
Copy link
Collaborator Author

slorber commented Jun 24, 2022

I think it's better this way.

Ok, we can try this

A little bit afraid it removes some flexibility in the end (like the ability to swap one of our provider for something else 🤷‍♂️ ), but not sure to have any good usecase so we'll see if anyone complains

The Layout/Provider comp would feel less useful now, but I'll still keep it as it's a good comp to swizzle

@github-actions
Copy link

github-actions bot commented Jun 24, 2022

Size Change: +65 B (0%)

Total Size: 802 kB

Filename Size Change
website/build/assets/js/main.********.js 604 kB +65 B (0%)
ℹ️ View Unchanged
Filename Size
website/.docusaurus/globalData.json 52.6 kB
website/build/assets/css/styles.********.css 107 kB
website/build/index.html 38.9 kB

compressed-size-action

@Josh-Cena
Copy link
Collaborator

Josh-Cena commented Jun 24, 2022

Ah sorry! I didn't make it clear. I meant I prefer the current way. (You know how much I don't like over-abstraction...)

@slorber
Copy link
Collaborator Author

slorber commented Jun 24, 2022

ah 😅 let's revert then. Anyway ejecting Layout/Provider is probably not very useful and users should probably just wrap it

@slorber slorber merged commit afc08ee into main Jun 24, 2022
@slorber slorber deleted the slorber/layout-provider branch June 24, 2022 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: maintenance This PR does not produce any behavior differences to end users when upgrading.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants